﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Pout_Porri.Objects.Interface;
using Pout_Porri.Utils;

namespace Pout_Porri.Objects
{
    class Wall : Enemy
    {
        private Animation wallStand;
        private string name;

        public Wall(Texture2D image, Vector2 position, Vector2 velocity, string name) : base(image, position, velocity)
        {
            this.name = name;
            this.texture = image;
            this.zOrder = 1;
            this.isAnimated = false;
            setGrounded(false);
        }

        public override void configAnimations()
        {
            wallStand = new Animation("wallstand", new Vector2(this.texture.Width, this.texture.Height), 100, 0, 0, 1, Axis.X);
            this.addAnimation(wallStand);

            this.spriteTexture = new Texture2D(Game1.graphics.GraphicsDevice, this.texture.Width, this.texture.Height);
       
            this.setCurrentAnimation("wallstand");
            currentState = EnemyStates.stand;
        }

        public override void update(GameTime gameTime)
        {

            if (currentState == EnemyStates.stand)
            {
                this.setCurrentAnimation("wallstand");
                this.currentAnimationRect = this.AnimationRect(wallStand);
                
            }
            
            base.update(gameTime);
        }

        public override void draw(SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(this.texture, new Rectangle((int)position.X, (int)position.Y, this.texture.Width, this.texture.Height), null, Color.White, 0.0f, Vector2.Zero, SpriteEffects.None, zOrder);
            
            //spriteBatch.Draw(this.texture, new Rectangle((int)position.X, (int)position.Y+60, this.texture.Width, this.texture.Height), null, Color.White, 0.0f, Vector2.Zero, SpriteEffects.None, 0.5f);
            base.draw(spriteBatch);
        }
        
    }
}
